UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3d+K8HNR4ZKXGSeXLp3wIn3S250ETK2cbiLqR6BhPms=' 
WHERE 
  key_id = 'ef79d32724772805cccde92ff8a1e7b3c6945f51cbc5b413c8dead36222a42f3' 
  AND (
    token = '3d+K8HNR4ZKXGSeXLp3wIn3S250ETK2cbiLqR6BhPms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051