UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'raIjYjGzyAei7+H87tukn2hCh61u5f9NwkI8/77Bw7Y='
WHERE
key_id = 'bda02650a11e9c9efb8b21b7a5294a54d8b77dd7ae468861eb65f4a2bfaacc9c'
AND (
token = 'raIjYjGzyAei7+H87tukn2hCh61u5f9NwkI8/77Bw7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)