UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/5KinrU/S89r1+GTV5JMT807rtPXYBZziQe5L7g8HiE='
WHERE
key_id = 'cd3750632feebd645b29dbb9e993f2c2f8e1bc39ea1d37a97a724077ea4af995'
AND (
token = '/5KinrU/S89r1+GTV5JMT807rtPXYBZziQe5L7g8HiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)