UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VrJlmrfobbYhun1JJaTlQbbxq4yTBL0VfCWUm3Gwn9Q='
WHERE
key_id = '1d6d199a80209ae2180f87536989fc82cc6ccf92bb23bb37a28ef82c77bf008e'
AND (
token = 'VrJlmrfobbYhun1JJaTlQbbxq4yTBL0VfCWUm3Gwn9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)