UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pWt4iDhWgmRygNjbFnzmGY/NYRYkY8bw4UgKvrGc2po=' 
WHERE 
  key_id = '01191c8cf28401798fe71f0041da3e626731ad1e09f92c1dce90118d3d443fa3' 
  AND (
    token = 'pWt4iDhWgmRygNjbFnzmGY/NYRYkY8bw4UgKvrGc2po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036