UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Apxwmf21NPgBRg3bcawFBShJai5oor1JE4VQ4ZkERIM='
WHERE
key_id = '416a6eb5d41208776222108776d40b6f21fa2b90d1a06216d88233c2f98eaf0e'
AND (
token = 'Apxwmf21NPgBRg3bcawFBShJai5oor1JE4VQ4ZkERIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)