UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nDaxHHK/1Te7noiZ5FHsstIzIG4kf/frDbRexcqwhLk=' 
WHERE 
  key_id = 'db4fe3ee0a01c2706fe2504aab9186a987bb5df67289f25648271075fc6221d3' 
  AND (
    token = 'nDaxHHK/1Te7noiZ5FHsstIzIG4kf/frDbRexcqwhLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035