UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ci2HjBKGmmzDdT5YZtNMB7jCyuRwx7zHtGmUY17+CHU='
WHERE
key_id = '0f1ead176bf035e4339e112980efa90112b7cc28814a8bc281f0a1b5c276c4d0'
AND (
token = 'ci2HjBKGmmzDdT5YZtNMB7jCyuRwx7zHtGmUY17+CHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)