UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CLcEPx4e7rXgAY+dNRcSPWiIKIu6/YM9kexL0nXeMvY='
WHERE
key_id = '29b413dd71a1378d2ccfdbbf4dcc73ddb61eb0a4a9b21d599284142514978a3a'
AND (
token = 'CLcEPx4e7rXgAY+dNRcSPWiIKIu6/YM9kexL0nXeMvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)