UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HDwyWhEcQpMYD1/w1JiTiDwA5yxLE4p/E2ugjsykO5s=' 
WHERE 
  key_id = '9315ceb99435786ed9414dacf034c5cdd8ba9d835663d19aac82d3613694b4a6' 
  AND (
    token = 'HDwyWhEcQpMYD1/w1JiTiDwA5yxLE4p/E2ugjsykO5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023