UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZ+Z2ZpMvm3B/WyHhLG/zPsPyXHZHTjfHuLnQAtOQXQ='
WHERE
key_id = '3b74fb106c47a877b3933c5dad88126d9f1425c75772050e2c2586e62db68827'
AND (
token = 'fZ+Z2ZpMvm3B/WyHhLG/zPsPyXHZHTjfHuLnQAtOQXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)