UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1KVgSnb/CMd8gA80OH54WUooiOJfGIrW0qJHH2NnnzI='
WHERE
key_id = 'da0f60554aa999cb3a28fd9bf7ed668d2f9ad0b57f8f1a92f86539c327119684'
AND (
token = '1KVgSnb/CMd8gA80OH54WUooiOJfGIrW0qJHH2NnnzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)