UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R35Fp0sD+8OEtqbjUNpGcj3HRMgZVb9y27UHzeC10Xg=' 
WHERE 
  key_id = 'acf0f8ba832598f03bc65b6ce04ac41a6934b835b4d1a60bc0eb311c8438282c' 
  AND (
    token = 'R35Fp0sD+8OEtqbjUNpGcj3HRMgZVb9y27UHzeC10Xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046