UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yamzuKiP35cfaIDkdam7U0JfmC1HEZQKAm7hm2nGJeY='
WHERE
key_id = '97ab33e83b2763ebe078388557e657ca3162c0c991a9c9a937cb2d4883a5a26e'
AND (
token = 'yamzuKiP35cfaIDkdam7U0JfmC1HEZQKAm7hm2nGJeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)