UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zb360MeNGq5nfgT00jV7Rzo3XBq4ANpIMmX26VGZNlQ='
WHERE
key_id = '9cc8f22775108bd7e0d6de91f817a196eb5bb1518343b3bf9a902fbc14017d11'
AND (
token = 'Zb360MeNGq5nfgT00jV7Rzo3XBq4ANpIMmX26VGZNlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)