UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YgyvrXpCqV8onotdhY5ZBvrUrdnaWaW9Sluo2uuN3YU='
WHERE
key_id = '2c71ad8b3fd242b531845b554c0735d65ee087b32944021469879783ab059769'
AND (
token = 'YgyvrXpCqV8onotdhY5ZBvrUrdnaWaW9Sluo2uuN3YU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)