UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jNibXn7WaLVgwsBI/PutLtDPDDi7BGaBqBCaz/UQYe8='
WHERE
key_id = 'ae6060fddeca5fe2b2fe78479442457bc7458a06c515596cd4e9e262bea80d36'
AND (
token = 'jNibXn7WaLVgwsBI/PutLtDPDDi7BGaBqBCaz/UQYe8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)