UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WDG9D1cpd/VaKtwC6iqY1RHmr0hHnrh1283IPg5L6c0=' 
WHERE 
  key_id = '30f7b25ea16b55a34990cc5051e63da465de4a3b2616f80eff845a448090d403' 
  AND (
    token = 'WDG9D1cpd/VaKtwC6iqY1RHmr0hHnrh1283IPg5L6c0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045