UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DyklPBXhdtrjq1yS5ZbU5MA19dqaC/tx4uy6bbotanw=' 
WHERE 
  key_id = '91fc84801a5f37cd59578e1acf27ed0276d9f101aa1e49209e6220c0959dee0f' 
  AND (
    token = 'DyklPBXhdtrjq1yS5ZbU5MA19dqaC/tx4uy6bbotanw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046