UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5MwG16QhaKMx4W9YYC1Ws5kApQr6UX8AZeHvXveokK4=' 
WHERE 
  key_id = '98af03ab937f28c962472cbc57e82132db352b75ff268120af201687e1c2ac5e' 
  AND (
    token = '5MwG16QhaKMx4W9YYC1Ws5kApQr6UX8AZeHvXveokK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033