UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/lmKCOgeSLS3Jq5YHRR6akBcr578pARA0+A5XYS7CVY='
WHERE
key_id = '2cbb55a4867d6a1ce271e892e58ea21482c40617e24ba29eb8549aaabfe081c4'
AND (
token = '/lmKCOgeSLS3Jq5YHRR6akBcr578pARA0+A5XYS7CVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)