UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd9rSROutcpvmJwI6sP8HMnkQVeHJMkkNuXgMfhx1Wys='
WHERE
key_id = 'a0bb5f74cfa88bec8fa43eb35feed7d7dad33db170293c280905a6d6be23fc8b'
AND (
token = 'd9rSROutcpvmJwI6sP8HMnkQVeHJMkkNuXgMfhx1Wys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)