UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8uo+FS7KXVye8QsquxswDNZHrLg/0i7dBJ8NUZQLAuo='
WHERE
key_id = '055c9b3401c9500ab542dafc5a66203868bfb742ff420a461118e0ef44ff28d8'
AND (
token = '8uo+FS7KXVye8QsquxswDNZHrLg/0i7dBJ8NUZQLAuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)