UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B4yBpEfJ0gvqYPbbNcerRmzxonpqwiLmfpYvJUJaGhI='
WHERE
key_id = '54839ea865a78ac92a554d4905d4e2d4eb1a657500e2bf1e44ea811cb66cc9a9'
AND (
token = 'B4yBpEfJ0gvqYPbbNcerRmzxonpqwiLmfpYvJUJaGhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)