UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mk0ZDD/fL+548GfdjNTdcQWI/eJk8U1eSO3WrTGD+AM=' 
WHERE 
  key_id = 'dc290fdb70de97962c374fa7c1ac3d2cd232311c765cbf84c0608fcb24c0ea4a' 
  AND (
    token = 'Mk0ZDD/fL+548GfdjNTdcQWI/eJk8U1eSO3WrTGD+AM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041