UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ivnmstUZgYLo3A+DwHnT3RiCsetHiRO5pvGmS5kXTeA='
WHERE
key_id = '60654dda9c2e88291616d94bd3746eef75d2fd9e3580d29bd2ce70417f7c25e1'
AND (
token = 'ivnmstUZgYLo3A+DwHnT3RiCsetHiRO5pvGmS5kXTeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)