UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sjer7JaA6FWoZvkU6R/LsAvxgd24l7d+23QMFl9f4vQ='
WHERE
key_id = '6f0ea5ad53e3fd01ed9c2ca0e18c8e6f49991f759262e6a02108675153133628'
AND (
token = 'sjer7JaA6FWoZvkU6R/LsAvxgd24l7d+23QMFl9f4vQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)