UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eXlPxzwDpPwo9p+AzIknQ4aL4s9T7uWaUW9hUrM0bPM=' 
WHERE 
  key_id = '989692c0825eff8c83d7c3b681c01ee6c13fc2e08b6f1cd4db602ec959b5b3a0' 
  AND (
    token = 'eXlPxzwDpPwo9p+AzIknQ4aL4s9T7uWaUW9hUrM0bPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030