UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wwe96+mJXHnD4N8RrGOqLz6vlVOhl1pBgp9F+hruMgY='
WHERE
key_id = '3302db3f963213686628e8f324c5511fa580c10db7fdaecf7e9fb207a55d4c93'
AND (
token = 'Wwe96+mJXHnD4N8RrGOqLz6vlVOhl1pBgp9F+hruMgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)