UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFlcygZsb9Xd3ce9uUEr8V+W43Syw3k8rQl3VdRbkcs=' 
WHERE 
  key_id = 'e08cb5ae85c31d190093154ad84e18d373813c67b795bccffb7175fe74a2d92f' 
  AND (
    token = 'kFlcygZsb9Xd3ce9uUEr8V+W43Syw3k8rQl3VdRbkcs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015