UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bVevunGZlEkmFQU/T+YcJMw4oeG+++2CQVehOH/Yvpw='
WHERE
key_id = 'd0eb5db73bd3aabc8935d156a285cc1a4a60cadc6eb7119fba743d7e19cdffbf'
AND (
token = 'bVevunGZlEkmFQU/T+YcJMw4oeG+++2CQVehOH/Yvpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)