UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iFcK4HpRWVjVrmD3jwcMEutQCSwJ++wKYAinfHlQaMo='
WHERE
key_id = 'ed12e813ba7c59a250d6236522e6996b7609bbf412b64dbe8ab6340509a4b6c2'
AND (
token = 'iFcK4HpRWVjVrmD3jwcMEutQCSwJ++wKYAinfHlQaMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)