UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jXnk3y9AKVw1otX3auXnUWqDvpd6xRUKgKOdE5r2PQo='
WHERE
key_id = '44b4f51401b30946feb2ea004621127ec019f80bb98e664031e088362a28539b'
AND (
token = 'jXnk3y9AKVw1otX3auXnUWqDvpd6xRUKgKOdE5r2PQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)