UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1/53QTVF+YxP0nq0Ac2UQD8WPkUfzdOzVEaRd/InDTo=' 
WHERE 
  key_id = '757d79e978447ad4fc4081e4c9b975a91191df37566223d3c51910db91e957ea' 
  AND (
    token = '1/53QTVF+YxP0nq0Ac2UQD8WPkUfzdOzVEaRd/InDTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036