UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eP1tCQb3qynArvcEUUdT/N+EyGcXx8JaNtXhOLJWQ04='
WHERE
key_id = '7b149e6bb95b5e9dd48d2f332a4a5d4322c79ce33fb2b2125bed201cb2da9d29'
AND (
token = 'eP1tCQb3qynArvcEUUdT/N+EyGcXx8JaNtXhOLJWQ04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)