UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EtqYvGtWUoV/kzws/YXHklx4jUt216D5oCrfyZUCFx0=' 
WHERE 
  key_id = '9aa67b6eaa92cc118bcf204e250ecb3b73c40adc2e8808a20366c486750e012a' 
  AND (
    token = 'EtqYvGtWUoV/kzws/YXHklx4jUt216D5oCrfyZUCFx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017