UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IqLu1s0zxeOkgf/6iSekW1eWqNdOn5hZ1BKJiR5G6dk='
WHERE
key_id = 'bcdf55872b6bdfcdaa02a5941bce6622ae9734d8da1acc4f2b2fcc5e9f601752'
AND (
token = 'IqLu1s0zxeOkgf/6iSekW1eWqNdOn5hZ1BKJiR5G6dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)