UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E9yaPf7A8OlCUZgpmNWZtnz/XLBjtoXXixvulzdZ+ew=' 
WHERE 
  key_id = '81adeeb9c9dfe33df3300f4f893ba6045af4547b1a5b565ed23621f3a2dd4e30' 
  AND (
    token = 'E9yaPf7A8OlCUZgpmNWZtnz/XLBjtoXXixvulzdZ+ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016