UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hWHL0xp3DFZZWM/esaVRCFO9sw8ZZsgPhhsDadYLu6w='
WHERE
key_id = 'f55d65fc4df203408c107dd07c68206c996c36fc6402bc66a5a1093f9c799589'
AND (
token = 'hWHL0xp3DFZZWM/esaVRCFO9sw8ZZsgPhhsDadYLu6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)