UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nROurygC+NTCVf944jhlqzYcokqi5xGiSbX/7EPJWaE=' 
WHERE 
  key_id = '85696d3546796290dbe387f9dbec147b255e6b2bbade07f7dce151ec287c5924' 
  AND (
    token = 'nROurygC+NTCVf944jhlqzYcokqi5xGiSbX/7EPJWaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033