UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2akmrWOciUZ09Jg0V3/zqIy5blVcvLCSDUSDrVy0sXE=' 
WHERE 
  key_id = '05a078077db0a641796151eae935c810e760780171472784171090c7e22ba835' 
  AND (
    token = '2akmrWOciUZ09Jg0V3/zqIy5blVcvLCSDUSDrVy0sXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034