UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jpoCJX2zgNUQipbVKw8oNrvBExHbQag7tG/tTZupYbI='
WHERE
key_id = 'f1268183ef49ea2b6ebf414c1c911d6d629bd8dffafddd900953e914214a8204'
AND (
token = 'jpoCJX2zgNUQipbVKw8oNrvBExHbQag7tG/tTZupYbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)