UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPU1iun7MLpZSVN7oOz3OnyLLYZSXKcu4OlVa6559Tc=' 
WHERE 
  key_id = '15f86070f646c037a79dde0cf77fb524d504a6cc943db586f8e65f6478eacc91' 
  AND (
    token = 'HPU1iun7MLpZSVN7oOz3OnyLLYZSXKcu4OlVa6559Tc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027