UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S787TyLymKgcjMSvHImDvKW9ZDRHiwojnWU/Kb6S4DI='
WHERE
key_id = '6caadfc1089834ec2390f824e468bbc225657b3d9f0d56e2c34eb303ce4b0dbf'
AND (
token = 'S787TyLymKgcjMSvHImDvKW9ZDRHiwojnWU/Kb6S4DI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)